
<script language="javascript"> 
  var mySwiper = new Swiper('.swiper-container',{
    pagination: '.pagination',
    resizeReInit : true,
    calculateHeight : true,
    autoplay : 5000,
    loop : true,
  });

  var mySwiper2 = new Swiper('.inforSwiper', {
    resizeReInit : true,
    calculateHeight : true,
    autoplay : 4000,
    loop : true,
  });

	$('.infor-nav ul li').click(function () {
   	 var index = $(this).index();
    $(this).addClass('active').siblings().removeClass('active');
     mySwiper2.swipeTo(index, 500, false);
  });
  $('.arrow-left').on('click', function(e){
    e.preventDefault()
    mySwiper.swipePrev()
  });
  $('.arrow-right').on('click', function(e){
    e.preventDefault()
    mySwiper.swipeNext()
  });

</script>

<script>
	$(".nav ul").on("click","li",function(){
		$(".nav ul li").removeClass("nav_active");
		$(this).addClass("nav_active");
	});
//图片切换
$(".infor_banner").yx_rotaion({auto:true});
</script>

<!--all--> 
<script>
$(function(){
  var t_li = $(".all .all_title li");
  var c_li = $(".all .all_content li");
  t_li.hover(function(){
    var i = t_li.index($(this));
    function way(){
      t_li.removeClass("all_cur").eq(i).addClass("all_cur");
      c_li.hide().eq(i).show();
    }
    timer=setTimeout(way,100);
    },function(){
    clearTimeout(timer);
  });
});
</script>

<script>
  $(function(){
      $(".show-more").click(function(event){
          event.preventDefault();
          var ticon = $(this).find("i");
              tspan = $(this).find("span");
              if($(this).hasClass("zk")){
                  $(this).siblings(".show-con").css("height","30px");
                  ticon.removeClass("icon-angle-up");
                  ticon.addClass("icon-angle-down");
                  tspan.html("更多");
                  $(this).removeClass("zk")
              }else{
                  $(this).siblings(".show-con").css("height","auto");
                  ticon.removeClass("icon-angle-down");
                  ticon.addClass("icon-angle-up");
                  tspan.html("收起");
                  $(this).addClass("zk")
              }
      })
  })
</script>

<!--返回顶部--> 
<script type="text/javascript">
	$(function(){
		showScroll();
		function showScroll(){
			$(window).scroll( function() { 
				var scrollValue=$(window).scrollTop();
				scrollValue > 100 ? $('div[class=back]').fadeIn():$('div[class=back]').fadeOut();
			} );	
			$('#back').click(function(){
				$("html,body").animate({scrollTop:0},200);	
			});	
		}
	});

  function ck_auth(m, id, cid){
    $.post(
      "{:url('home/common/ck_auth')}",
      {m:m, id:id, cid:cid},
      function(d){
        // console.log(d);return false;
        if(d.code == 1){
          window.location.href = d.url;
        }else{
          alert(d.msg);
        }
    });
  }

</script>

<link rel="stylesheet" href="__STATIC__/plugins/layui/css/layui.css" media="all" />
<script type="text/javascript" src="__STATIC__/plugins/layui/layui.js"></script>

<script type="text/javascript">

  layui.use(['layer', 'form'], function(){
    var layer = layui.layer
    ,form = layui.form;

      //监听提交
    $('.pp').on('click', function(){
      var m = $(this).attr('data-m');
      var id = $(this).attr('data-id');
      var cid = $(this).attr('data-cid');
      // console.log(m);
      // return false;

      $.post(
        "{:url('home/common/ck_auth')}",
        {m:m, id:id, cid:cid},
        function(d){
          // console.log(d);
          // return false;
          if(d.code == 1){
            // layer.msg(d.msg, {icon:1});
            window.location.href = d.url;
          }else{
            layer.msg(d.msg, {icon:5});
            // if(d.url){
            //   window.location.href = d.url;
            // }
          }
        });
      return false;
    });
  });
</script>